package com.grass.p019lv.adapter.svip;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.bean.AdInfoBean;
import com.androidx.p013lv.base.bean.InventionBean;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.invention.OnInventionType;
import com.grass.p019lv.view.svip.SvipOneView;
import com.grass.p019lv.view.svip.SvipThreeView;
import com.grass.p019lv.view.svip.SvipTwoView;
import java.util.List;

/* renamed from: com.grass.lv.adapter.svip.AdapterSvipType */
public class AdapterSvipType extends BaseRecyclerAdapter<InventionBean, Holder> {
    private boolean clickLimit = true;
    String domain;
    private long lastClickTime;
    List<AdInfoBean> listAd;
    OnInventionType onInventionType;

    public AdapterSvipType(OnInventionType onInventionType2, List<AdInfoBean> list) {
        this.onInventionType = onInventionType2;
        this.listAd = list;
    }

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((InventionBean) this.list.get(i), i, getItemViewType(i));
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public int getItemViewType(int i) {
        return ((InventionBean) this.list.get(i)).getType();
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        View view;
        LayoutInflater from = LayoutInflater.from(viewGroup.getContext());
        switch (i) {
            case 21:
                view = from.inflate(R.layout.item_svip_one, viewGroup, false);
                break;
            case 22:
                view = from.inflate(R.layout.item_svip_two, viewGroup, false);
                break;
            case 23:
                view = from.inflate(R.layout.item_svip_three, viewGroup, false);
                break;
            default:
                view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_invention_no, viewGroup, false);
                break;
        }
        return new Holder(view, i);
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.grass.lv.adapter.svip.AdapterSvipType$Holder */
    public class Holder extends BaseRecyclerHolder {
        SvipOneView svipOneView;
        SvipThreeView svipThreeView;
        SvipTwoView svipTwoView;

        public Holder(View view, int i) {
            super(view);
            switch (i) {
                case 21:
                    this.svipOneView = new SvipOneView(view, null, AdapterSvipType.this.domain, AdapterSvipType.this.onInventionType);
                    return;
                case 22:
                    this.svipTwoView = new SvipTwoView(view, null, AdapterSvipType.this.domain, AdapterSvipType.this.onInventionType);
                    return;
                case 23:
                    this.svipThreeView = new SvipThreeView(view, null, AdapterSvipType.this.domain, AdapterSvipType.this.onInventionType);
                    return;
                default:
                    return;
            }
        }

        public void setData(InventionBean inventionBean, int i, int i2) {
            switch (i2) {
                case 21:
                    this.svipOneView.setView(inventionBean, i);
                    return;
                case 22:
                    this.svipTwoView.setView(inventionBean, i);
                    return;
                case 23:
                    this.svipThreeView.setView(inventionBean, i);
                    return;
                default:
                    return;
            }
        }
    }

    /* access modifiers changed from: protected */
    public boolean isOnClick() {
        long currentTimeMillis = System.currentTimeMillis();
        long j = currentTimeMillis - this.lastClickTime;
        if (j > 1000) {
            this.lastClickTime = currentTimeMillis;
        }
        return !this.clickLimit ? j < 0 : j <= 1000;
    }
}
